package org.ws.edu.task1.qizer;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by IntelliJ IDEA.
 * User: qizer
 * Date: 28.09.11
 * Time: 15:05
 * small calc to work with only numbers and primitive operations:'+','-','*','='
 */
public class SmallCalc {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		System.out.print("Input XznakY: ");
		try {
			String str = br.readLine();
			int a = Integer.valueOf(String.valueOf(str.charAt(0)));
			int b = Integer.valueOf(String.valueOf(str.charAt(2)));
			int c;
			switch (str.charAt(1)) {
				case '+':
					c = a + b;
					System.out.println(str + "=" + c);
					break;
				case '-':
					c = a - b;
					System.out.println(str + "=" + c);
					break;
				case '*':
					c = a * b;
					System.out.println(str + "=" + c);
					break;
				case '/':
					c = a / b;
					System.out.println(str + "=" + c);
					break;
			}
		} catch (IOException e) {
			e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
		}
	}
}
